from ihome import create_app, db
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand

# 使用工厂模式创建应用程序，用来区分开发模式和生产模式
app = create_app("develop")
app.jinja_env.auto_reload = True
app.debug = True
manager = Manager(app=app)

Migrate(app, db)
manager.add_command("db", MigrateCommand)

if __name__ == '__main__':
    # app.debug = True
    # app.run(host='0.0.0.0', port=80)
    manager.run()



